//
//  TypePlainTableViewCell.m
//  Final
//
//  Created by Pibinuo on 15/12/2.
//  Copyright © 2015年 皮比诺. All rights reserved.
//

#import "TypePlainTableViewCell.h"

@implementation TypePlainTableViewCell


#pragma mark 为什么不走这里面的东西
//当是从StoryBoard拖出来的控件，不会走这个方法，而是  -(void)awakeFromNib {
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        //        [self set];
        //        [self.favouriteButton setImage:[UIImage imageNamed:@"face"] forState:(UIControlStateSelected)];
    }
    return self;
}

-(void)set
{
    //    self.headView = [[UIImageView alloc]init];
    //    self.headView.backgroundColor = [UIColor brownColor];
    //    [self.contentView addSubview:self.headView];
    //
    //    self.nameLabel = [[UILabel alloc]init];
    //    self.nameLabel.backgroundColor = [UIColor cyanColor];
    //    [self.contentView addSubview:self.nameLabel];
    //
    //    self.contentLabel = [[UILabel alloc]init];
    //    self.contentLabel.backgroundColor = [UIColor yellowColor];
    //    [self.contentView addSubview:self.contentLabel];
    self.headView.layer.cornerRadius = 15;
    self.headView.layer.masksToBounds = YES;
    
    
}
//-(void)layoutSubviews
//{
//    [super layoutSubviews];
//    self.headView.frame = CGRectMake(5, 4, 50, 40);
//    self.contentLabel.frame = CGRectMake(5, CGRectGetHeight(self.headView.frame) + 5, self.contentView.frame.size.width - 10, self.contentView.frame.size.height - 80);
//    self.nameLabel.frame = CGRectMake(5, self.contentView.frame.size.height - 50, self.contentView.frame.size.width - 10, 40);
//
//
//}
- (IBAction)changface:(id)sender {
    self.favouriteButton.highlighted = YES;
    self.favouriteButton.adjustsImageWhenHighlighted = YES;
    
}



- (void)awakeFromNib {
    [self set];
    
    [self.favouriteButton setImage:[UIImage imageNamed:@"face"] forState:(UIControlStateSelected)];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}



@end
